package com.twu.biblioteca.control;

import com.twu.biblioteca.library.main.Library;

import java.lang.reflect.Method;
import java.util.HashMap;

public class CommandControl {

    public HashMap<Integer, Method> mainCommands;

    public CommandControl() throws NoSuchMethodException {
        mainCommands = new HashMap<Integer, Method>();
        mainCommands.put(1, Library.class.getDeclaredMethod("menuListBooks"));
        mainCommands.put(2, Library.class.getDeclaredMethod("menuCheckoutBook"));
        mainCommands.put(3, Library.class.getDeclaredMethod("menuReturnBook"));
        mainCommands.put(4, Library.class.getDeclaredMethod("menuListMovies"));
        mainCommands.put(5, Library.class.getDeclaredMethod("menuCheckoutMovie"));
        mainCommands.put(6, Library.class.getDeclaredMethod("menuUserInformation"));
    }

    public Method getMethod(int option){
        return mainCommands.get(option);
    }


}
